<script setup>



import { ref } from 'vue'

const person = ref({
  name:'王宁',
  age:23
})
const changeName = () => person.value.name = '王宁是我儿'
const changeAge = () => person.value.age++
const car = ref('马自达')
const changeCar = () => car.value = '劳斯莱斯'
</script>

<template>
  <div>
   <div>{{ person }}</div>
   <button @click="changeName">修改姓名</button>
   <button @click="changeAge"> 增加年龄</button>
  </div>
   <div>
    {{ car }}
    <button @click="changeCar">发财买车</button>
   </div>
</template>

<style scoped>

</style>
